{% extends "common/layout.html" %}

{% block css_assets %}
{% assets "css_school" %}
  <link rel="stylesheet" href="{{ ASSET_URL }}">
{% endassets %}
{% endblock %}

{% block page_title %}
{{ page_title }} - {{translate('机构管理系统')}}
{% endblock %}

{% block nav %}
{% include "school/nav.html" %}
{% endblock %}

{% block js_assets %}
{% assets "js_school" %}
    <script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}
    <script type="text/javascript">
    var href=location.href;
    {% if current_user.is_admin %}
    if(href.indexOf('teachers')!=-1){
        sessionStorage.setItem('school',1);
    }
    else if(href.indexOf('students')!=-1){
        sessionStorage.setItem('school',2);
    }
    else if(href.indexOf('classrooms')!=-1){
        sessionStorage.setItem('school',3);
    }
    else if(href.indexOf('classes')!=-1){
        sessionStorage.setItem('school',4);
    }
    {% else %}
    if(href.indexOf('students')!=-1){
        sessionStorage.setItem('school',1);
    }
    else if(href.indexOf('classrooms')!=-1){
        sessionStorage.setItem('school',2);
    }
    else if(href.indexOf('classes')!=-1){
        sessionStorage.setItem('school',3);
    }
    {% endif %}
    </script>
{% endblock %}
{% block js_bottom %}
<script>
    (function(){
        if(true || (window.location.search != '' && window.location.search.indexOf('lang=en')>0)){
            // just hidden the function
            // var real_name_auth = document.getElementById('li_real_name_auth');
            // if(real_name_auth != null){
            //     real_name_auth.remove()
            // }
        }

        var scriptObj = document.createElement('script');
        scriptObj.src = 'http://www.sobot.com/chat/pc/pc.min.js?sysNum=d54f8b00efc044ecaa3d7f89852d6701&?partnerId={{ current_user.id }}&uname={{ current_user.school.name }}.{{ current_user.name }}';
        scriptObj.id = 'zhichiload';
        if(localStorage.lang !== 'lang=en'){
            document.getElementsByTagName('body')[0].appendChild(scriptObj);
        }
    })()
</script>
{% endblock %}
